home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / slpmem.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  1.8 KB  |  47 lines

  1.       subroutine slpmem(ipntr,ksize)
  2.       implicit double precision (a-h,o-z)
  3. c
  4. c      this routine may be used to define a certain amount of `slop' to
  5. c be associated with a particular table managed by the memory manager.
  6. c this *slop* is defined as a number of entries in the table for which
  7. c space is to be held ***if possible*** during compaction of the managed
  8. c area of memory.  this feature can eliminate the overhead incurred by
  9. c alternatively extending more than one table at a time.  (for example,
  10. c if the program contains a code sequence
  11. c
  12. c                  do 100 i=1,500
  13. c                     ...
  14. c                  call extmem(table1,1)
  15. c                     ...
  16. c                  call extmem(table2,1)
  17. c                     ...
  18. c              100 continue
  19. c
  20. c then the overhead incurred by this memory manager can be reduced to
  21. c essentially nothing if prior to the above code sequence the program
  22. c executes
  23. c
  24. c                  call slpmem(table1,20)
  25. c                  call slpmem(table2,20)
  26. c
  27. c where `20' is a typical number (for the above example, the memory-to-
  28. c memory copying overhead of the memory manager would be reduced by a
  29. c factor of 20).
  30. c
  31. c spice version 2g.6  sccsid=memmgr 3/15/83
  32.       common /memmgr/ cpyknt,istack(1),lorg,icore,maxcor,maxuse,memavl,
  33.      1   ldval,numblk,loctab,ltab,ifwa,nwoff,ntab,maxmem,memerr,nwd4,
  34.      2   nwd8,nwd16
  35. c spice version 2g.6  sccsid=flags 3/15/83
  36.       common /flags/ iprnta,iprntl,iprntm,iprntn,iprnto,limtim,limpts,
  37.      1   lvlcod,lvltim,itl1,itl2,itl3,itl4,itl5,itl6,igoof,nogo,keof
  38.       dimension ipntr(1)
  39.       islp=nxtevn(ksize)
  40.       call extmem(ipntr,islp)
  41.       islp=islp*istack(ltab+5)
  42.       istack(ltab+3)=istack(ltab+3)-islp
  43.       memavl=memavl+istack(ltab+6)
  44.       istack(ltab+6)=islp
  45.       return
  46.       end
  47.